﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

/* Generated with http://xmltocs.com/ */
namespace EDMXParserV1
{
    public class EntityTypeMapping
    {
        public String TypeName { get; set; }
        public MappingFragment MappingFragment { get; set; }

        public static EntityTypeMapping New(System.Xml.XmlNode Node)
        {
            EntityTypeMapping EntityTypeMapping = new EntityTypeMapping();
            foreach (XmlAttribute Attribute in Node.Attributes)
            {
                switch (Attribute.Name)
                {
                    case "TypeName":
                        EntityTypeMapping.TypeName = Attribute.Value;
                        break;

                    default:
                        Globals.AttributeSwitchCoder(Attribute);
                        break;
                }

            }

            foreach (XmlNode ChildNode in Node.ChildNodes)
            {
                switch (ChildNode.Name)
                {
                    case "MappingFragment":
                        EntityTypeMapping.MappingFragment = MappingFragment.New(ChildNode);
                        break;
                    default:
                        Globals.NodeSwitchCoder(ChildNode);
                        break;
                }
            }

            return EntityTypeMapping;

        }
    }
}
